package com.gdcp.mapper;

import com.gdcp.beans.Comment;
import com.gdcp.beans.User;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

@Repository
public interface CommentMapper {

    int insert(Comment comment);

    List<Comment> queryListByProductId(@Param("product_id") Integer id);

    Comment queryInfoById(@Param("user_id") Integer user_id, @Param("product_id") Integer product_id, @Param("orderitem_id") Integer id);

    void doSupport(@Param("id") Integer cid);

    void doOppose(@Param("id") Integer cid);

    List<Comment> queryListByUID(@Param("user_id") Integer id);

    int deleteById(@Param("id") Integer id);

    List<Comment> findPageBreakByCondition(Object o);

    int removeByPrimaryKey(Integer id);

    int updateByPrimaryKey(Comment comment);

    Comment getInformation(Integer id);

    List<Comment> searchInformation(Map<String, Object> param);

    //List<Comment> queryByParentId(Integer parent_id);

    Comment queryInfoByParentId(Integer parent_id);

    List<Comment> getPageNumber(Integer user_id);

    List<Comment> queryByPage(@Param(value = "user_id") Integer user_id, @Param(value = "pc") int pc, @Param(value = "ps") int ps);

    List<Comment> findPageBreakByConditionByShopId(@Param(value = "shop_id") Integer shop_id);

    List<Comment> findAll(Map<String, Object> model);

    List<Comment> searchInformationByShopId(Map<String, Object> model);

    Comment getInformationByParentId(@Param(value = "parent_id") Integer id);

    Comment getInformationByOrderItemId(@Param(value = "orderitem_id") Integer id);
}
